import request from '@/utils/request'

// http://localhost:8080/login
// http://localhost:8080/dev-api/pp/login
export function login(data) {
  return request({
    url: '/pp/login',
    method: 'post',
    data
  })
}

export function getCode() {
  return request({
    url: '/pp/login/code',
    method: 'get'
  })
}

export function getInfo() {
  return request({
    url: '/pp/sys/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/pp/logout',
    method: 'post'
  })
}

export function passwordUpdate({ password, newPassword }) {
  return request({
    url: '/pp/sys/password/update',
    method: 'post',
    data: { newPassword, password }
  })
}

export function infoUpdate(data) {
  return request({
    url: '/pp/sys/info/update',
    method: 'post',
    data
  })
}

export function info() {
  return request({
    url: '/pp/sys/info',
    method: 'get'
  })
}

